#include "enemy.h"

const int enemy::MAXNUM = 20;

enemy::enemy() : buff(20, 0) { Hp = 0; }

int enemy::getHp() { return Hp; }

void enemy::setHp(int a) {
  Hp += a;

  if (Hp < 0) Hp = 0;
}

int enemy::getMp() { return this->Mp; }

void enemy::setMp(int a) {
  Mp += a;

  if (Mp < 0) Mp = 0;
}

int enemy::getIsAct() { return this->isAct; }

void enemy::setIsAct(int a) {
  if ((a == 1) || (a == 0)) {
    isAct = a;
  }
}

void enemy::setShield(int a) {
  shield += a;

  if (shield < 0) shield = 0;
}

void enemy::setExtraPower(int a) {
  extraPower += a;

  if (extraPower < 0) extraPower = 0;
}

int enemy::getShield() { return this->shield; }

int enemy::getExtraPower() { return this->extraPower; }

void enemy::setAtack(int a) { this->atack = a; }

int enemy::getMaxHp() { return maxHp; }

void enemy::setMaxHp(int value) { maxHp = value; }

int enemy::getAtack() { return this->atack; }

void enemy::clearbuff() {
  for (int i = 0; i < MAXNUM; i++) {
    buff[i] = 0;
  }
}
void enemy::addbuff(int a, int b) { buff[a] += b; }
int enemy::getbuff(int a) { return buff[a]; }
